<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="email=no" name="format-detection"/>
    <meta content="telephone=no" name="format-detection" />
    <link href="/Public/css/layout.css" type="text/css" rel="stylesheet" >
    <link href="/Public/css/coverflow.css" type="text/css" rel="stylesheet" >
    <script src="/Public/js/jquery-1.10.1.min.js"></script>
</head>
<body>
<!--search start-->
<div class="search">
    <div class="search-cont"><a href="javascript:history.back();"><span class="sch-qx">取消</span></a>
        <div class="search-inp"><i class="icon-iconfont-sousuo"></i>
            <div class="search-input-box">
                <input class="search-input" type="text" placeholder="输入关键字">
            </div>
        </div>
    </div>
</div>
<!-- search end-->
<div class="page-ec">
    <div class="h45"></div>
    <div class="search-con"> <span class="search-tit"><i class="icon-iconfont-icon28"></i> 大家都在搜</span>
        <ul class="search-ul">
            <?php foreach($our_search as $v){ ?>
            <li><a href="/search/<?php echo ($v); ?>"><?php echo ($v); ?></a></li>
            <?php } ?>
        </ul>
    </div>
    <div class="search-con"> <span class="search-tit">
        <i class="icon-iconfont-clock"></i>搜索历史
        <span class="search-trash">
            <a id="trash_search_history" href="javascript:void (0);"><i class="icon-iconfont-trash"></i>清空</a>
        </span>
    </span>
        <ul class="search-ul">
        </ul>
    </div>
</div>
</body>
<script>
    $(function(){
        if($('.search-ul').length > 0){
            localStorage.search_history = ['海王','科室'];
            var search_history = localStorage.search_history;
            history_info=search_history.split(","); //字符分割
            var lis = '';
            for(i = 0 ; i < history_info.length ; i++) {
                lis += '<li><a href="/search/'+ history_info[i] +'"> '+ history_info[i] +'</a></li>';
            }
            $('.search-ul').eq(1).append(lis);
        }

        $('#trash_search_history').on('click',function(){
            localStorage.search_history = [];
            $('.search-ul').eq(1).empty();
        })
    })
</script>
</html>